<!-- 横向柱状图 -->
<template>
  <vue-chart :option="option" ref="chart" />
</template>

<script setup lang="ts">
// 多折线图
import VueChart from "vue-echarts";
import { use } from "echarts/core";
import { TooltipComponent, GridComponent } from "echarts/components";
import { CanvasRenderer } from "echarts/renderers";
import { LineChart } from "echarts/charts";
import { options } from "./options";
use([CanvasRenderer, LineChart, GridComponent, TooltipComponent]);

const props = defineProps<{
  config: any;
}>();

const option = ref(options);
const chart = ref();

watch(
  () => props.config.width,
  () => chart.value.resize()
);
watch(
  () => props.config.height,
  () => chart.value.resize()
);
</script>

<style scoped lang="scss"></style>
